import request from '@/utils/request'
const baseUrl = process.env.VUE_APP_BASE_API
// 图片上传

export const uploadUrl = `${baseUrl}/common/upload`
export function uploadFile(data = {}) {
  return request.post('/common/upload', data, { showError: false })
}

// 根据字典类型获取字典
export function getDictList(data = {}) {
  return request.post('/common/dict/getDict', data)
}

// 获取行业列表
export function getIndustryList(data = {}) {
  return request.post('/common/industry/list', data)
}

// 根据行业查询类目列表
export function getCategoryList(data = {}) {
  return request.post('/common/category/getTree', data)
}

// 根据行业和协议类型获取协议
export function getAgreementByCondition(data = {}) {
  return request.post('/common/agreement/getByCondition', data)
}

// 获取最近的审批记录
export function getLatestApprove(data = {}) {
  return request.post('/common/approve/getLatest', data)
}

// 获取店铺装修最近审核记录
export function getLatestShop(data = {}) {
  return request.post('/common/shop/approve/getLatest', data)
}

// 撤回店铺审核
export function rollShopBack(params = {}) {
  return request.get('/common/shop/approve/rollback', { params })
}

// 撤回产品审核
export function rollProductBack(params = {}) {
  return request.get('/common/product/approve/rollback', { params })
}

// 获取产品审核状态
export function getApproveDetail(params = {}) {
  return request.get('/common/product/approve/detail', { params })
}
